package com.demo.util;


import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.io.Closeable;

/**
 * description 流的工具类
 */
public final class StreamUtil {

    private static final Logger LOGGER = LogManager.getLogger(StreamUtil.class);

    public static void closeStream(Closeable... closeables) {
        for (Closeable closeable : closeables) {
            try {
                if (closeable != null) {
                    closeable.close();
                }
            } catch (Exception e) {
                LOGGER.error(e.getMessage(), e);
            }
        }
    }
}